(function() {
  var cardTypeDisplay, cartDiv, cartIcon;

  cartIcon = $('.cart-icon');

  cartDiv = $('.cart-display');

  cardTypeDisplay = $('.card-type')[0];

  cartIcon.on('click', function(e) {
    if (e.target.checked) {
      cartDiv.addClass('cart-active');
    } else {
      cartDiv.removeClass('cart-active');
    }
  });

  $('.form-checkout').on('submit', function(e) {
    e.preventDefault();
  });

  $('.p-label').on('click', function(e) {
    cardTypeDisplay.style.backgroundImage = window.getComputedStyle(e.target, false).backgroundImage;
  });

}).call(this);